home *** CD-ROM | disk | FTP | other *** search
-
-
- x
-
- x
-
- åWhat Does Menu Events Do?
-
-
-
- Menu Events is a system extension. Once you have placed it in your
-
- Extensions folder and restarted your Macintosh, it adds a small suite of
-
- Apple events (“Menu events”) to the set supported by every
-
- high-level-event-aware application. Also, if the Caps Lock key is down,
-
- it alters menu selection logic so that every selection causes the
-
- application to send itself a Menu event. This behavior enables script
-
- recording of menu actions.
-
-
-
- Many people are justly wary of control panels and system extensions,
-
- because of the conflicts they often cause with System software and with
-
- each other. These conflicts usually result from competitive trap patching.
-
-
- Menu Events installs a GetNextEvent filter and patches the MenuSelect
-
- trap at system startup to enable the self-sending behavior, and installs an
-
- Apple event handler in the system dispatch table. The Apple event handler
-
- cannot conflict with any other, because it is bound specifically to the
-
- Menu event class. Menu Events does patch some traps “on the fly” to
-
- simulate menu selection, but the patches remove themselves immediately.
-
-
- There are three events defined in the suite, and they work as follows.
-
- See the section entitled “Menu Events Suite” for more information on the
-
- Menu Events suite.
-
-
-
-
- xQuery Menu List Event
-
-
- This event, with no parameters, queries the menu list of the target
-
- application. If the application is high-level-event-aware, not
-
- background-only, and has a menu bar, it will return a list of records, each
-
- containing a menu ID (integer), a title (string), an enable/disable
-
- (Boolean), and a menu definition procedure resource ID (integer)
-
- parameter. If you do not know the IDs of the target application’s menus,
-
- this is one way to find out. (Another way is to press the Caps Lock key
-
- and record menu actions using a script editor; yet another is to use the
-
- Menu Grabber application, also part of AWOL Utilities.) Be aware that
-
- menu IDs do not have to agree with 'MENU' resource IDs, though they
-
- often do.
-
-
- See the section entitled “Suggestions for Use” for more information on
-
- Menu Grabber.
-
-
- System menus (Keyboard, Help, Application), hierarchical menus, and
-
- pop-up menus do not appear in this list, but the Apple menu does.
-
-
- NOTE: The standard menu definition procedure ('MDEF') resource ID is 0.
-
- A value of -1 indicates that the menu definition procedure is not a
-
- resource. Non-standard menu definition procedures may have abnormal
-
- ways of counting, disabling, and displaying menu items, so be careful with
-
- them.
-
-
-
-
- xQuery Menu Event
-
-
- This event, given a menu ID (integer) parameter, queries the items of a
-
- certain target application menu. If the application has a menu with that
-
- ID, be it a regular, system, hierarchical, or pop-up menu, it will return a
-
- list of records, each containing a menu item ID (integer), an item title
-
- (string), an enable/disable (Boolean), a mark character (integer), an icon
-
- ID (integer), a style value (integer), and a Command character (integer)
-
- parameter. The items are numbered starting from 1 at the top end of the
-
- menu. Separators appear as disabled items with an item title of “-”.
-
-
-
- This event does work for menus which use a non-standard menu definition
-
- procedure ('MDEF'), but the results may or may not reflect what you see
-
- when you pull down the menu, depending on how the procedure was
-
- programmed.
-
-
-
-
- xSelect Menu Item Event
-
-
- This event, given a menu ID (integer) and a menu item ID (integer)
-
- parameter, asks the application to act as though the user pulled down that
-
- menu and selected that item. This does not work for the Keyboard and
-
- Application menus, which are not under the control of the application, nor
-
- for the upper (System-defined) part of the Help menu, but it works for
-
- any regular, application-defined, enabled menu item.
-
-
-
- You may optionally include Boolean parameters to indicate which modifier
-
- keys (Shift, Control, Option, Command) are pressed at the time of the
-
- simulated menu item selection, in case this makes a difference in the
-
- effect of the selection.
-
-
- This event does work for menus which use a non-standard menu definition
-
- procedure ('MDEF'), but the results may or may not reflect what happens
-
- when you select from the menu, depending on how the procedure was
-
- programmed.
-
-
- This event brings the target application to the front before forcing the
-
- menu selection upon it. If the sender was on the same machine, and was
-
- previously in front, it returns to the front after the menu action is
-
- complete.
-
- See the section entitled “How Does Menu Events Work?” for more
-
- information about the method by which Menu Events activates the target
-
- application.
-
-
-
-